﻿@model LeadExpress.Models.ViewPages.ProductManagementModel
           
@{
    ViewBag.Title = "Thêm mới bản tin RV24";
    Layout = "~/Views/Shared/_Layout.MyAccount.cshtml";
}
<form method="post" class="form" action="/MyAccount/ProductList/Add">
	<fieldset id="apps">
		<h2 class="app">
	        <strong>Express - Thêm mới bản tin RV24</strong>
        </h2>
		<div class="errorMessage" data-bind="visible: InvalidateForm" >
			<span class="error">Xin hãy nhập thông tin bên dưới chính xác.</span>
		</div>				
		<div class="title nomargin">
			<h3>Thông tin RV24</h3>
		</div>
                
        <!-- Error messages -->
        <div id="errorMessages" style="display:none;">
			<span class="errorgrid">                            
            </span>
		</div>
        <div class="clear"></div>

        <!-- Group tabs -->
        <span id="grouptab" class="toolbar">
            <span class="area button active">
                <a class="nexttab" href="#tab1">Thông tin bản tin<span class="arr"></span> </a>
            </span>
            <span class="area button">
                <a class="nexttab" href="#tab2">Thông tin chi tiết<span class="arr"></span> </a>
            </span>
            <span class="area button">
                <a class="nexttab" href="#tab3">Thông tin danh mục/vùng<span class="arr"></span> </a>
            </span>
            <span class="area button">
                <a class="nexttab" href="#tab4">Thông tin phí<span class="arr"></span> </a>
            </span>
        </span>
        <div class="clear"></div>

        <div id="groupfields" class="panel grouped-form">
            <!-- Group 1 -->
            <ul id="tab1" class="accordeon-tabs accordeon-2">
                <li class="open">
                    <span class="panel">
                        <div class="row">
					        <label for="text1">Tiêu đề:</label>
					        <input class="text" type="text" style="width:550px" data-bind="value: Title, attr:{maxlength:250}" name="Title" />
				        </div>
                        <div class="row">
					        <label for="text10">Từ khóa (Meta):</label>
					        <input class="text" type="text" style="width: 550px" data-bind="value: MetaKeywords, attr:{maxlength:250}" name="MetaKeywords"/>
				        </div>
				        <div class="row">
					        <label for="text2">Mô tả (Meta):</label>
					        <input class="text" type="text" style="width: 550px" data-bind="value: MetaDescription, attr:{maxlength:250}" name="MetaDescription" />
				        </div>
				        <div id="editform" class="row">
					        <label for="text12">Kích hoạt:</label>
                            <div class="groupinput"><input class="text" type="checkbox" data-bind="checked: Active" name="Active" /></div>					    
				        </div>
                        <div class="row">Tóm lược bản tin</div>
                        <div class="row">
				            <textarea id="elm1" class="text" cols="80" rows="15" style="width: 100%" data-bind="value: ShortDesc, attr:{maxlength:500}" name="ShortDesc">
                            </textarea>
			            </div>
                    </span>
                </li>
            </ul>

            <!-- Group 2 -->
            <ul id="tab2" class="accordeon-tabs accordeon-2">
                <li class="open">
                    <span class="panel">
                        <div class="row">
				            <textarea id="elm2" class="text" cols="80" rows="35" style="width: 100%; height:600px;" data-bind="value: LongDesc" name="LongDesc">
                            </textarea>
			            </div>
                    </span>
                </li>
            </ul>

            <!-- Group 3 -->
            <ul id="tab3" class="accordeon-tabs accordeon-2">
                <li class="open">
                    <span class="panel">   
                        <div class="columns">
                            <div class="col" style="width:450px">                  
				                <div id="editform" class="row">
					                <label for="text12">Hiển thị tất cả:</label>
                                    <div class="groupinput2">
                                        <input class="text" type="checkbox" data-bind="checked: AllCategories" name="AllCategories" />
                                        <span class="optionText">Chọn</span>
                                    </div>					    
				                </div>
                                <div class="row">                        
					                <label for="text12">Danh mục:</label>
                                    <div class="select-holder">
                                        <select class="select" validation="ddlrequired" name="CategoryID" data-bind="value: CategoryID, foreach: CategoryList">
                                            <option data-bind="value: ID, text: Name"></option>
                                        </select>
                                    </div>
                                </div>
                                <div class="row">              
					                <label for="text12">Danh mục con:</label>
                                    <select class="select multiple" validation="ddlrequired" name="SubCategoryID" data-bind="foreach: SubCategoryList" size="12">
                                        <option data-bind="value: ID, text: Name"></option> 
                                    </select>
                                </div>  
                            </div>
                            <div class="col" style="width:450px">                      
				                <div id="editform" class="row">
					                <label for="text12">Hiển thị tất cả:</label>
                                    <div class="groupinput2">
                                        <input class="text" type="checkbox" data-bind="checked: AllStates" name="AllStates" />
                                        <span class="optionText">Chọn</span>
                                    </div>					    
				                </div>

                                <div class="row">                        
					                <label for="text12">Tỉnh / thành:</label>
                                    <div class="select-holder">
                                        <select class="select" validation="ddlrequired" name="StateID" data-bind="value: StateID, foreach: StateList">
                                            <option data-bind="value: ID, text: Name"></option>
                                        </select>
                                    </div>
                                </div>
                                <div class="row">              
					                <label for="text12">Quận huyện / Phường xã:</label>
                                    <select class="select multiple" validation="ddlrequired" name="DistrictID" data-bind="foreach: DistrictList" size="12">
                                        <option data-bind="value: ID, text: Name"></option> 
                                    </select>
                                </div>
                            </div>
                        </div>  
                    </span>
                </li>
            </ul>
            
            <!-- Group 4 -->
            <ul id="tab4" class="accordeon-tabs accordeon-2">
                <li class="open">
                    <span class="panel">                                               
				        
                        <div class="row">
					        <label for="text1">Chọn loại bản tin:</label>
					        <div class="groupinput" data-bind="foreach: GroupList">
                                <input type="radio" name="GroupID" data-bind="value: ID, checked: $parent.GroupID" /> <span data-bind="text: Name"></span>&nbsp;
                            </div>
				        </div>
                        <div class="row">
					        <label for="text1">Chọn sản phẩm:</label>
					        <div class="groupinput">
                                <table cellpadding="0" border="0" data-bind="foreach: OptionList">
                                    <tr>
                                        <td style="padding-bottom:9px; padding-right:3px"><input type="radio" name="OptionID" data-bind="value: ID, checked: $parent.OptionID" /> </td>
                                        <td style="padding-bottom:7px">
                                            <span class="bold" data-bind="text: ShortDesc"></span> -
                                            <span class="optionText">(<span data-bind="text: Name"></span> <span class="data-bind='text: (LongTimeValue + "" + LongTimeUnit)'></span>)</span> 
                                            <span class="smallText" data-bind='text: (OptionPrice + " " + UnitPrice)'></span>
                                        </td>
                                    </tr>
                                </table>
                            </div>
				        </div>
                        <div class="row">
					        <label for="text1">Phương thức thanh toán:</label>
					        <div class="groupinput" data-bind="foreach: PaymentList">
                                <input type="radio" name="PaymentID" data-bind="value: ID, checked: $parent.PaymentID" /> <span data-bind="text: Name"></span>&nbsp;
                            </div>
				        </div>
                        <div id="editform" class="row">
					        <label for="text12">Bản tin trả phí:</label>
                            <div class="groupinput">
                                <input class="text" type="checkbox" data-bind="checked: NoAcceptPayment" name="AcceptPayment" />
                                <span class="optionText">Chọn nếu bạn muốn đăng tin trả phí</span>
                            </div>					    
				        </div>
                    </span>
                </li>
            </ul>
        </div>

		<div class="title nomargin end">
            <span class="left-btns">
                <a class="btn btn-cancel-small" href="/MyAccount/ProductList">cancel</a>
            </span>
            <span class="right-btns">
                <a class="btn btn-submit-small" id="submit" href="##" data-bind="click: SubmitForm">submit</a>
            </span>
		</div>
	</fieldset>
</form>
<script type="text/javascript">
    var data = @(Html.Raw(Json.Encode(Model)));
</script>
<script src="/Scripts/Lib/AddProduct.js" type="text/javascript"></script>
<script src="/TinyMCE/tiny_mce.js" type="text/javascript"></script>
<script src="/TinyMCE/tinymce.initialize.js" type="text/javascript"></script>